package com.zn.quartz;

import com.zn.dto.VeiReportInfoDTO;
import com.zn.dto.VeiReportInfoDTO2;
import com.zn.services.VeiReportInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@EnableScheduling
public class ReportArchiveTiming {

    @Autowired
    private VeiReportInfoService veiReportInfoService;

    //每天凌晨执行
    @Scheduled(cron = "0 0 0 */1 * ?")
    public void test() {
        int count1 = veiReportInfoService.archiveReport1();
        int count2 = veiReportInfoService.archiveReport2();
        System.out.println("共归档报告1:"+count1+"个");
        System.out.println("共归档报告2:"+count2+"个");
    }
}
